import * as events from 'events';
const myEmitter = new events.EventEmitter();

// myEmitter.on('error', (err: Error) => {
//     console.log(`Error: ${err.message}`);
// });

process.on('uncaughtException', (err) => {
    console.error('Ooops', err.stack);
    process.exit(1);
});

myEmitter.emit('error', new Error('Something is wrong'));
